package IteratorAndComposite.composite;

import IteratorAndComposite.composite.entry.Menu;
import IteratorAndComposite.composite.entry.MenuItem;
import IteratorAndComposite.composite.interfaces.MenuComponent;
import IteratorAndComposite.composite.waitess.Waitess;

/**
 * @Author: pengzx
 * @Description:
 * @Date: 15:32 2017/9/26
 * @Modified by: 1.0
 */
public class Demo {
    public static void main(String[] args){
        MenuComponent pancakeMenu = new Menu("pancakeMenu名字...","pancakeMenu描述...");
        MenuComponent dinerMenu = new Menu("dinerMenu名字...", "dinerMenu描述...");
        MenuComponent cafeMenu = new Menu("cofeMenu名字", "cofeMenu描述...");
        MenuComponent dessertMenu = new Menu("dessertMenu名字...", "dessertMenu描述...");
        MenuComponent allMenu = new Menu("顶级菜项", "顶级菜项");

        //加入到顶级菜单中
        allMenu.add(pancakeMenu);
        allMenu.add(dinerMenu);
        allMenu.add(cafeMenu);
        allMenu.add(dessertMenu);

        //添加菜单项
        dinerMenu.add(new MenuItem("蛋炒饭","鸡蛋炒饭",false,3.91));

        dinerMenu.add(dessertMenu);

        dessertMenu.add(new MenuItem("苹果派","苹果派描述",true,12.43));

        Waitess waitess = new Waitess(allMenu);
        waitess.printMenu();
    }
}
